package com.xiaoming.api;

import com.xiaoming.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MailController {
    @Autowired
    private MailService mailService;

    @GetMapping("/{email}/{content}")
    public boolean sendMail(@PathVariable("email") String email, @PathVariable("content") String content) throws Exception {
       return mailService.sendMail(email, "注册验证码", content, null, null);
    }
}
